<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : Perforce Source Control Block</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : Perforce Source Control Block
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Sep 11, 2008 by <font color="#0050B2">williams</font>.
				    </div>

				    <h3><a name="PerforceSourceControlBlock-PerforceConfigurationExamples"></a>Perforce Configuration Examples</h3>

<p>Example using defaults:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"p4"</span>&gt;</span>
   <span class="code-tag">&lt;view&gt;</span>//projects/myproject/...<span class="code-tag">&lt;/view&gt;</span>
<span class="code-tag">&lt;/sourcecontrol&gt;</span></pre>
</div></div>
<p>Full example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"p4"</span>&gt;</span>
   <span class="code-tag">&lt;view&gt;</span>//projects/ccnet/...,//tools/nant/...<span class="code-tag">&lt;/view&gt;</span>
   <span class="code-tag">&lt;executable&gt;</span>c:\perforce\p4.exe<span class="code-tag">&lt;/executable&gt;</span>
   <span class="code-tag">&lt;client&gt;</span>ccnet-buildhost<span class="code-tag">&lt;/client&gt;</span>
   <span class="code-tag">&lt;user&gt;</span>public<span class="code-tag">&lt;/user&gt;</span>
   <span class="code-tag">&lt;password&gt;</span>mypassword<span class="code-tag">&lt;/password&gt;</span>
   <span class="code-tag">&lt;port&gt;</span>perforce01.thoughtworks.net:1666<span class="code-tag">&lt;/port&gt;</span>
   <span class="code-tag">&lt;timeZoneOffset&gt;</span>-5<span class="code-tag">&lt;/port&gt;</span>
   <span class="code-tag">&lt;applyLabel&gt;</span>true<span class="code-tag">&lt;/applyLabel&gt;</span>
   <span class="code-tag">&lt;autoGetSource&gt;</span>true<span class="code-tag">&lt;/autoGetSource&gt;</span>
   <span class="code-tag">&lt;forceSync&gt;</span>true<span class="code-tag">&lt;/forceSync&gt;</span>
   <span class="code-tag">&lt;p4WebURLFormat&gt;</span>http://perforceWebServer:8080/@md=d&amp;amp;cd=//&amp;amp;c=3IB@/{0}?ac=10<span class="code-tag">&lt;/p4WebURLFormat&gt;</span>
   <span class="code-tag">&lt;timeout units=<span class="code-quote">"minutes"</span>&gt;</span>10<span class="code-tag">&lt;/timeout&gt;</span>
<span class="code-tag">&lt;/sourcecontrol&gt;</span></pre>
</div></div>

<h3><a name="PerforceSourceControlBlock-ConfigurationElements%3A"></a>Configuration Elements:</h3>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Node </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Required </th>
<th class='confluenceTh'> Default </th>
</tr>
<tr>
<td class='confluenceTd'> view </td>
<td class='confluenceTd'> The perforce 'view' to check for changes. For 'multi-line' views, use a comma-separated list. 'Exclusionary' view lines starting with <tt>&#45;</tt> cannot be used. Use a <a href="Filtered Source Control Block.html" title="Filtered Source Control Block">Filtered Source Control Block</a> to achieve this behaviour. Note that this view is <b>not</b> used for syncing (see below.) </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> true </td>
<td class='confluenceTd'> <em>n.a.</em> </td>
</tr>
<tr>
<td class='confluenceTd'> executable </td>
<td class='confluenceTd'> The location of the Perforce command line client executable </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> <tt>p4.exe</tt> in path </td>
</tr>
<tr>
<td class='confluenceTd'> client </td>
<td class='confluenceTd'> The perforce 'client' to use </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> Perforce environment setting </td>
</tr>
<tr>
<td class='confluenceTd'> user </td>
<td class='confluenceTd'> The perforce user to use </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> Perforce environment setting </td>
</tr>
<tr>
<td class='confluenceTd'> password </td>
<td class='confluenceTd'> The perforce password to use </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> Perforce environment setting </td>
</tr>
<tr>
<td class='confluenceTd'> port </td>
<td class='confluenceTd'> The perforce hostname and port to use </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> Perforce environment setting </td>
</tr>
<tr>
<td class='confluenceTd'> timeZoneOffset </td>
<td class='confluenceTd'> How many hours ahead your Perforce Server is from your build server. E.g. if your build server is in London, and your Perforce server is in New York, this value would be '-5'. </td>
<td class='confluenceTd'> double </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> 0 </td>
</tr>
<tr>
<td class='confluenceTd'> applyLabel </td>
<td class='confluenceTd'> Whether to apply a label on a successful build, defaults to false </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> autoGetSource </td>
<td class='confluenceTd'> Whether to automatically 'sync' the latest changes from source control before performing the build. The sync target is the entire view exposed by the specified <tt>client</tt> &#45; the <tt>view</tt> has no effect on sycning. </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> forceSync </td>
<td class='confluenceTd'> If <tt>autoGetSource</tt> is set to true, then whether to use the <tt>&#45;f</tt> option to sync. See <a href="http://www.perforce.com/perforce/doc.042/manuals/cmdref/sync.html">here</a> for more details </td>
<td class='confluenceTd'> boolean </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> p4WebURLFormat </td>
<td class='confluenceTd'> Creates a link to the P4Web change list page for each detected modification.  The specified value is transformed using String.Format where the first argument ({0}) will be the substituted change list number </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> <em>n.a.</em> </td>
</tr>
<tr>
<td class='confluenceTd'> timeout </td>
<td class='confluenceTd'> Sets the timeout period for the source control operation. See <a href="Timeout Configuration.html" title="Timeout Configuration">Timeout Configuration</a> for details. </td>
<td class='confluenceTd'> Timeout </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> 10 minutes </td>
</tr>
<tr>
<td class='confluenceTd'> issueUrlBuilder </td>
<td class='confluenceTd'> Converts the comment (or parts from it) into an url pointing to the issue for this build. <br clear="all" />
See <a href="IssueUrlBuilder.html" title="IssueUrlBuilder">Issue Builder</a> for more details <br clear="all" /> </td>
<td class='confluenceTd'> Group </td>
<td class='confluenceTd'> N/A </td>
<td class='confluenceTd'> false <br clear="all" /> </td>
</tr>
</tbody></table>

<h3><a name="PerforceSourceControlBlock-Client%2FUser%2FPassword%2FPortusage"></a>Client / User / Password / Port usage</h3>

<p>You may specify any of the Perforce client, user, password and port (ie 'host:port' in Perforce standards) settings to use. If you don't specify them, then Cruise Control .NET will use the defaults in your registry (use 'p4 set' to view and edit these.)</p>

<p>Note that the <em>client</em> specification is only used for syncing and applying labels, it is not used when checking for changes. This is significant since it means that the <em>view</em> in the specified <em>client</em> does not effect the plugin's behaviour when checking for changes.</p>

<h3><a name="PerforceSourceControlBlock-PerforceIssues"></a>Perforce Issues</h3>

<p>Perforce cannot apply purely numeric labels, which is what CCNet uses by default. Therefore, if you have 'applyLabel' set to true, you <b>must</b> also setup a custom Labeller in your project, e.g. by using the <a href="Default Labeller.html" title="Default Labeller">Default Labeller</a>.</p>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>